<template>
    <div>
        <div class="mui-numbox" data-numbox-min="1" >
            <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
            <input class="mui-input-numbox" type="number" :value="initcount"  @change = "countChange" ref="count" />
            <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
        </div>
    </div>
</template>
<script>
import mui from '../../lib/mui/js/mui.min'
export default {
    mounted(){
        //初始化数字选择框组件
        mui('.mui-numbox').numbox();
        console.log(this.max)
    },
    methods:{
        countChange(){
          console.log(this.$refs.count.value)
          this.$store.commit("updateCar",{
              id: this.goodsid,
              count: this.$refs.count.value
          })
        },
    },
    props:['initcount','goodsid']
}
</script>
<style lang="scss" scoped>
    
</style>
